/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

export const enum YogaDisplay {
  FLEX = 0,
  NONE = 1
}

export function getYogaDisplayFromNumber(value: number): YogaDisplay | never {
  switch (value) {
    case 0: return YogaDisplay.FLEX;
    case 1: return YogaDisplay.NONE;
    default: throw new Error("Unknown enum value: " + value);
  }
}

//export class YogaDisplay {
//  public static readonly FLEX = 0
//  public static readonly NONE = 1;
//
//  private readonly mIntValue: number;
//
//  constructor(intValue: number) {
//    this.mIntValue = intValue;
//  }
//
//  public intValue(): number {
//    return this.mIntValue;
//  }
//
//  public static fromInt(value: number): number | never {
//    switch (value) {
//      case 0: return YogaDisplay.FLEX;
//      case 1: return YogaDisplay.NONE;
//      default: throw new Error("Unknown enum value: " + value);
//    }
//  }
//}
